﻿CREATE PROCEDURE spGetUpdatedRowsSince
	@name nvarchar(255),
	@stamp bigint
AS
  DECLARE @cmd AS nvarchar(max);
  DECLARE @ParmDefinition nvarchar(max);
  DECLARE @pstamp bigint;
  SET @cmd = N'SELECT ID FROM ' + @name + ' WHERE _UpdateStamp > @pstamp';
  EXEC sp_executesql @cmd, N'@pstamp bigint', @pstamp = @stamp;
